package com.example.demo.server3.template;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

public class CMPP_SUBMIT_RESP implements ProtocolTemplate {
    private MessageHeader messageHeader;
    private long Msg_Id;
    private byte Result;

    public CMPP_SUBMIT_RESP(long msg_Id, byte result) {
        Msg_Id = msg_Id;
        Result = result;
    }

    @Override
    public void structure(ByteBuf buf) {

    }

    @Override
    public ByteBuf destruct() {
        ByteBuf superByteBuf = messageHeader.destruct();
        ByteBuf byteBuf = Unpooled.buffer(9);
        ByteBuf byteBufAll = Unpooled.buffer(21);
        byteBuf.writeLong(Msg_Id);
        byteBuf.writeByte(Result);
        byteBufAll.writeBytes(superByteBuf);
        byteBufAll.writeBytes(byteBuf);
        return byteBufAll;
    }

    public MessageHeader getMessageHeader() {
        return messageHeader;
    }

    public void setMessageHeader(MessageHeader messageHeader) {
        this.messageHeader = messageHeader;
    }

    public long getMsg_Id() {
        return Msg_Id;
    }

    public void setMsg_Id(long msg_Id) {
        Msg_Id = msg_Id;
    }

    public byte getResult() {
        return Result;
    }

    public void setResult(byte result) {
        Result = result;
    }
}
